package com.aiyige.base.glide;

import android.content.Context;

import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.cache.ExternalCacheDiskCacheFactory;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.module.AppGlideModule;


/**
 * Created by zhuyakun on 2017/9/25.
 */
@GlideModule
public class AiyigeGlideModule extends AppGlideModule {
    @Override
    public boolean isManifestParsingEnabled() {
        return false;
    }

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        super.applyOptions(context, builder);
        builder.setMemoryCache(new LruResourceCache(10 * 1024 * 1024));
        builder.setDiskCache(new ExternalCacheDiskCacheFactory(context, "AiYiGeGlideCache", 100 * 1024 * 1024));
    }
}
